<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_CreateTable_StudentInfo extends CI_Migration
{
    public function up()
    {
        $this->dbforge->add_field('id');
        $this->dbforge->add_field(array(
            'student_num'  => array('type' => 'VARCHAR', 'constraint' => '50', 'null' => TRUE,),
            'student_name' => array('type' => 'VARCHAR', 'constraint' => '50', 'null' => TRUE,),
            'grade'        => array('type' => 'VARCHAR', 'constraint' => '20', 'null' => TRUE,),
            'major'        => array('type' => 'VARCHAR', 'constraint' => '30', 'null' => TRUE,),
            'user_id'      => array('type' => 'INT', 'constraint' => '9', 'null' => TRUE,),
            'school_id'    => array('type' => 'INT', 'constraint' => '9',),
        ));
        $this->dbforge->create_table('student_info');
    }

    public function down()
    {
        $this->dbforge->drop_table('student_info');
    }
} 